const query=require("../utils/query");
const tables={
  addRegister:`create table if not exists register(
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    phone CHAR(11) NOT NULL,
    username VARCHAR(100) NOT NULL,
    password VARCHAR(100) NOT NULL
  );`
}

const createTable=tb=>{
  query(tb,()=>{
    console.log("建表成功")
    return true
  }),(err)=>{
    console.log("建表失败",err)
    return false;
  }
}

for(let key in tables){
  if(tables.hasOwnProperty(key)){
    createTable(tables[key]);
  }
}